



import {Node} from '@antv/x6'
import {Graph} from '@antv/x6'

Graph.registerNode(
  'Bus',
  {
    inherit: 'rect', // 继承于 name 节点
    width: 40,
    height: 60,
    label: '总线',
    // path:'M29.9778 13.5C13.824 13.5 0 72 0 72C24.9211 60.6668 38.1114 60.6665 59.9556 72C59.9556 72 46.1317 13.5 29.9778 13.5Z',
    attrs: {
      body: {
        stroke: '#6DC1E3',
        strokeWidth: 1,
        fill: '#6DC1E3',
        // rx: 6,
        // ry: 6,
      },
    },
    ports: {
      groups: {
        top: {
          position: {
            name:'top',
            args:{
              // dx:10,
              // dy:0,
              // angle:10,
              // x:40,
              // y:30
            }
          },
          attrs: {
            circle: {
              magnet: true,
              stroke: '#8f8f8f',
              r: 5,
              visibility:'hidden',
            },
          },
        },
        bottom1: {
          position: {
            name:'bottom',
            args:{
              dx:-14,
              // dy:-10
            }
          },
          attrs: {
            circle: {
              magnet: true,
              stroke: '#8f8f8f',
              r: 5,
              visibility:'hidden',
            },
          },
        },
        bottom2: {
          position: 'bottom',
          attrs: {
            circle: {
              magnet: true,
              stroke: '#8f8f8f',
              r: 5,
              visibility:'hidden',
            },
          },
        },
        bottom3: {
          position: {
            name:'bottom',
            args:{
              dx:14
            }
          },
          attrs: {
            circle: {
              magnet: true,
              stroke: '#8f8f8f',
              r: 5,
              visibility:'hidden',
            },
          },
        },
      },
    },
  },
  true,
)




/**数据库节点 */
export const Bus: Node.Metadata = {
  shape: 'Bus',   //对应上面注册的 name
  attrs: {

  },
  ports: {
    items: [
      {
        id: 'port_1',
        group: 'top',
      },
      {
        id: 'port_2',
        group: 'bottom1',
      },
      {
        id: 'port_3',
        group: 'bottom2',
      },
      {
        id: 'port_4',
        group: 'bottom3',
      },
    ],
  },
}




